﻿using System;
using System.ComponentModel;

namespace RiskMan.DataClass.Models.Quik
{

    /// <summary>
    /// Таблица квик - Ограничения по клиентским счетам 
    /// </summary>
    public class LimitByAccountModel : INotifyPropertyChanged
    {
        private String _company;
        private String _account;
        private String _typeLimit;
        private double _kmolotiluas;
        private double _lastLimitOpenPosition;
        private double _limitOpenPosition;
        private double _currentEmptyPosition;
        private double _currentEmptyOrder;
        private double _currentEmptyOpen;
        private double _planEmptyPosition;
        private double _variableMarga;
        private double _dohod;
        private double _bonusByOption;
        private double _birgaSbor;
        private double _countGo;

        #region public
        /// <summary>
        /// Фирма 
        /// </summary>
        public String Company
        {
            get { return _company; }
            set
            {
                if (_company != value)
                {
                    _company = value;
                    RaisePropertyChanged("Company");
                }
            }
        }

        /// <summary>
        /// Торговый счет
        /// </summary>
        public String Account
        {
            get { return _account; }
            set
            {
                if (_account != value)
                {
                    _account = value;
                    RaisePropertyChanged("Account");
                }
            }
        }

        /// <summary>
        /// Тип лимита 
        /// </summary>
        public String TypeLimit
        {
            get { return _typeLimit; }
            set
            {
                if (_typeLimit != value)
                {
                    _typeLimit = value;
                    RaisePropertyChanged("TypeLimit");
                }
            }
        }

        /// <summary>
        /// Коэф. Лимита
        /// </summary>
        public double Kmolotiluas
        {
            get { return _kmolotiluas; }
            set
            {
                if (_kmolotiluas != value)
                {
                    _kmolotiluas = value;
                    RaisePropertyChanged("Kmolotiluas");
                }
            }
        }

        /// <summary>
        /// Пред.Лимит открытых поз. 
        /// </summary>
        public double LastLimitOpenPosition
        {
            get { return _lastLimitOpenPosition; }
            set
            {
                if (_lastLimitOpenPosition != value)
                {
                    _lastLimitOpenPosition = value;
                    RaisePropertyChanged("LastLimitOpenPosition");
                }
            }
        }

        /// <summary>
        /// Лимит открытых позиций
        /// </summary>
        public double LimitOpenPosition
        {
            get { return _limitOpenPosition; }
            set
            {
                if (_limitOpenPosition != value)
                {
                    _limitOpenPosition = value;
                    RaisePropertyChanged("LimitOpenPosition");
                }
            }
        }

        /// <summary>
        /// Тек. чистая позиций
        /// </summary>
        public double CurrentEmptyPosition
        {
            get { return _currentEmptyPosition; }
            set
            {
                if (_currentEmptyPosition != value)
                {
                    _currentEmptyPosition = value;
                    RaisePropertyChanged("CurrentEmptyPosition");
                }
            }
        }

        /// <summary>
        /// Тек.чистая позиция под заявки
        /// </summary>
        public double CurrentEmptyOrder
        {
            get { return _currentEmptyOrder; }
            set
            {
                if (_currentEmptyOrder != value)
                {
                    _currentEmptyOrder = value;
                    RaisePropertyChanged("CurrentEmptyOrder");
                }
            }
        }

        /// <summary>
        /// Тек.чистая позиция под открытые
        /// </summary>
        public double CurrentEmptyOpen
        {
            get { return _currentEmptyOpen; }
            set
            {
                if (_currentEmptyOpen != value)
                {
                    _currentEmptyOpen = value;
                    RaisePropertyChanged("CurrentEmptyOpen");
                }
            }
        }

        /// <summary>
        /// Планогвая чистая позиция 
        /// </summary>
        public double PlanEmptyPosition
        {
            get { return _planEmptyPosition; }
            set
            {
                if (_planEmptyPosition != value)
                {
                    _planEmptyPosition = value;
                    RaisePropertyChanged("PlanEmptyPosition");
                }
            }
        }

        /// <summary>
        /// Вариационная маржа
        /// </summary>
        public double VariableMarga
        {
            get { return _variableMarga; }
            set
            {
                if (_variableMarga != value)
                {
                    _variableMarga = value;
                    RaisePropertyChanged("VariableMarga");
                }
            }
        }

        /// <summary>
        /// Доход
        /// </summary>
        public double Dohod
        {
            get { return _dohod; }
            set
            {
                if (_dohod != value)
                {
                    _dohod = value;
                    RaisePropertyChanged("Dohod");
                }
            }
        }

        /// <summary>
        /// Премия по опционам
        /// </summary>
        public double BonusByOption
        {
            get { return _bonusByOption; }
            set
            {
                if (_bonusByOption != value)
                {
                    _bonusByOption = value;
                    RaisePropertyChanged("BonusByOption");
                }
            }
        }

        /// <summary>
        /// Биржевые сборы 
        /// </summary>
        public double BirgaSbor
        {
            get { return _birgaSbor; }
            set
            {
                if (_birgaSbor != value)
                {
                    _birgaSbor = value;
                    RaisePropertyChanged("BirgaSbor");
                }
            }
        }

        /// <summary>
        /// Коэфф. кол
        /// </summary>
        public double CountGo
        {
            get { return _countGo; }
            set
            {
                if (_countGo != value)
                {
                    _countGo = value;
                    RaisePropertyChanged("CountGo");
                }
            }
        } 
        #endregion


    #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
